<html>
<head>
<style>
.error { color: #ff0000; }
</style>
<script src="jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="jquery.numberformatter-1.1.2.min.js" type="text/javascript"></script>
<script>

$(document).ready(function() {

   $("#formatTest1").format({format:"#,###.00", locale:"US"});
   $("#formatTest1a").format({format:"#,###.00", locale:"us"});
   $("#formatTest2").format({format:"#,###.0", locale:"us"});
   $("#formatTest2a").format({format:"#,###.0", locale:"us"});
   $("#formatTest3").format({format:"#,###.#", locale:"us"});
   $("#formatTest3a").format({format:"#,###.#", locale:"us"});
   $("#formatTest4").format({format:"####.00", locale:"us"});
   $("#formatTest4a").format({format:"####.00", locale:"us"});
   $("#formatTest5").format({format:"#,###", locale:"us"});
   $("#formatTest5a").format({format:"#,###", locale:"us"});
   $("#formatTest6").format({format:"#,###", locale:"us"});
   $("#formatTest6a").format({format:"#,###", locale:"us"});
   $("#formatTest7").format({format:"#", locale:"us"});
   $("#formatTest8").format({format:"0000", locale:"us"});
   $("#formatTest9").format({format:"0", locale:"us"});
   $("#formatTest10").format({format:"#", locale:"us"});
   $("#formatTest11").format({format:"#,###.00", locale:"us"});
   $("#formatTest12").format({format:"-#,###.00", locale:"us"});
   $("#formatTest12a").format({format:"#,###.00", locale:"us"});
   $("#formatTest13").format({format:"$#,###.00", locale:"us"});
   $("#formatTest13a").format({format:"USD#,###.00", locale:"us"});
   $("#formatTest13b").format({format:"#,###.00USD", locale:"us"});
   $("#formatTest13c").format({format:"#,###.00 USD", locale:"us"});
   $("#formatTest13d").format({format:"-$#,###.00", locale:"us"});
   $("#formatTest13e").format({format:"$#,###.00", locale:"us"});
   $("#formatTest14").format({format:"#.##%", locale:"us"});
   $("#formatTest14a").format({format:"#.00%", locale:"us"});
   $("#formatTest15").format({format:"-#,###.00", locale:"us"});
   $("#formatTest15a").format({format:"-#,###.00", locale:"us"});
   $("#formatTest16").format({format:"#,###.###", locale:"us"});
   $("#formatTest17").format({format:"#,###,###", locale:"us"});


   $("#formatTestDe1").format({format:"#,###.00", locale:"DE"});
   $("#formatTestDe1a").format({format:"#,###.00", locale:"de"});
   $("#formatTestDe2").format({format:"#,###.0", locale:"de"});
   $("#formatTestDe2a").format({format:"#,###.0", locale:"de"});
   $("#formatTestDe3").format({format:"#,###.#", locale:"de"});
   $("#formatTestDe3a").format({format:"#,###.#", locale:"de"});
   $("#formatTestDe4").format({format:"####.00", locale:"de"});
   $("#formatTestDe4a").format({format:"####.00", locale:"de"});
   $("#formatTestDe5").format({format:"#,###", locale:"de"});
   $("#formatTestDe5a").format({format:"#,###", locale:"de"});
   $("#formatTestDe6").format({format:"#,###", locale:"de"});
   $("#formatTestDe6a").format({format:"#,###", locale:"de"});
   $("#formatTestDe7").format({format:"#", locale:"de"});
   $("#formatTestDe8").format({format:"0000", locale:"de"});
   $("#formatTestDe9").format({format:"0", locale:"de"});
   $("#formatTestDe10").format({format:"#", locale:"de"});
   $("#formatTestDe12").format({format:"-#,###.00", locale:"de"});
   $("#formatTestDe12a").format({format:"#,###.00", locale:"de"});
   

   $("#formatTestFr1").format({format:"#,###.00", locale:"fr"});
   $("#formatTestFr1a").format({format:"#,###.00", locale:"fr"});
   $("#formatTestFr2").format({format:"#,###.0", locale:"fr"});
   $("#formatTestFr2a").format({format:"#,###.0", locale:"fr"});
   $("#formatTestFr3").format({format:"#,###.#", locale:"fr"});
   $("#formatTestFr3a").format({format:"#,###.#", locale:"fr"});
   $("#formatTestFr4").format({format:"####.00", locale:"fr"});
   $("#formatTestFr4a").format({format:"####.00", locale:"fr"});
   $("#formatTestFr5").format({format:"#,###", locale:"fr"});
   $("#formatTestFr5a").format({format:"#,###", locale:"fr"});
   $("#formatTestFr6").format({format:"#,###", locale:"fr"});
   $("#formatTestFr6a").format({format:"#,###", locale:"fr"});
   $("#formatTestFr7").format({format:"#", locale:"fr"});
   $("#formatTestFr8").format({format:"0000", locale:"fr"});
   $("#formatTestFr9").format({format:"0", locale:"fr"});
   $("#formatTestFr10").format({format:"#", locale:"fr"});
   $("#formatTestFr12").format({format:"-#,###.00", locale:"fr"});


   $("#formatTestCh1").format({format:"#,###.00", locale:"ch"});
   $("#formatTestCh1a").format({format:"#,###.00", locale:"ch"});
   $("#formatTestCh2").format({format:"#,###.0", locale:"ch"});
   $("#formatTestCh2a").format({format:"#,###.0", locale:"ch"});
   $("#formatTestCh3").format({format:"#,###.#", locale:"ch"});
   $("#formatTestCh3a").format({format:"#,###.#", locale:"ch"});
   $("#formatTestCh4").format({format:"####.00", locale:"ch"});
   $("#formatTestCh4a").format({format:"####.00", locale:"ch"});
   $("#formatTestCh5").format({format:"#,###", locale:"ch"});
   $("#formatTestCh5a").format({format:"#,###", locale:"ch"});
   $("#formatTestCh6").format({format:"#,###", locale:"ch"});
   $("#formatTestCh6a").format({format:"#,###", locale:"ch"});
   $("#formatTestCh7").format({format:"#", locale:"ch"});
   $("#formatTestCh8").format({format:"0000", locale:"ch"});
   $("#formatTestCh9").format({format:"0", locale:"ch"});
   $("#formatTestCh10").format({format:"#", locale:"ch"});
   $("#formatTestCh12").format({format:"-#,###.00", locale:"ch"});

   $("#formatTestDefault1").format();
   $("#formatTestDefault2").format({format:"#,###"});
   $("#formatTestDefault3").format({locale:"de"});


   $(".f").each(function(){
      $(this).format({format:"#,###.00", locale:"en"});
   });


   alert("Should be 2342.34 " + $("#parseTest1").parse({locale:"en"}));
   alert("Should be 2342.34 " + $("#parseTest2").parse({locale:"en"}));
   alert("Should be -2342.34 " + $("#parseTest3").parse({locale:"en"}));
   alert("Should be -2342.34 " + $("#parseTest4").parse({locale:"en"}));
   alert("Should be -2342.34 " + $("#parseTest5").parse({locale:"en"}));
   alert("Should be 2342.34 " + $("#parseTest6").parse({locale:"en"}));
   alert("Should be 2342 " + $("#parseTest7").parse({locale:"en"}));
   alert("Should be 0.2342 " + $("#parseTest8").parse({locale:"en"}));


   $(".check").each(function(){
      if ($(this).text() != $(this).next().text())
         $(this).next().addClass("error");
   });


   alert("This should all be the same decimal - " + $("#formatTest1").parse({locale:"en"}) + " " + $("#formatTestDe1").parse({locale:"de"}) + " " + $("#formatTestFr1").parse({locale:"fr"}) + " " + $("#formatTestCh1").parse({locale:"ch"}));

});

</script>

</head>
<body>

<p>US Locale
<p><span class=check id=formatTest1>4335.20</span> <span>4,335.20</span>
<p><span class=check id=formatTest1a>4,335.20</span> <span>4,335.20</span>
<p><span class=check id=formatTest2>4335.20</span> <span>4,335.2</span>
<p><span class=check id=formatTest2a>4,335.20</span> <span>4,335.2</span>
<p><span class=check id=formatTest3>4335.20</span> <span>4,335.2</span>
<p><span class=check id=formatTest3a>4,335.20</span> <span>4,335.2</span>
<p><span class=check id=formatTest4>4335.20</span> <span>4335.20</span>
<p><span class=check id=formatTest4a>4,335.20</span> <span>4335.20</span>
<p><span class=check id=formatTest5>4335.20</span> <span>4,335</span>
<p><span class=check id=formatTest5a>4,335.20</span> <span>4,335</span>
<p><span class=check id=formatTest6>4335.80</span> <span>4,336</span>
<p><span class=check id=formatTest6a>4,335.80</span> <span>4,336</span>
<p><span class=check id=formatTest7>4335.80</span> <span>4336</span>
<p><span class=check id=formatTest8>566</span> <span>566</span>
<p><span class=check id=formatTest9>566</span> <span>566</span>
<p><span class=check id=formatTest10>566.0</span> <span>566</span>
<p><span class=check id=formatTest11>10450213</span> <span>10,450,213.00</span>
<p><span class=check id=formatTest12>-2342.34</span> <span>-2,342.34</span>
<p><span class=check id=formatTest12a>-2342.34</span> <span>-2,342.34</span>
<p><span class=check id=formatTest13>2342.34</span> <span>$2,342.34</span>
<p><span class=check id=formatTest13a>2342.34</span> <span>USD2,342.34</span>
<p><span class=check id=formatTest13b>2342.34</span> <span>2,342.34USD</span>
<p><span class=check id=formatTest13c>2342.34</span> <span>2,342.34 USD</span>
<p><span class=check id=formatTest13d>-2342.34</span> <span>-$2,342.34</span>
<p><span class=check id=formatTest13e>-2342.34</span> <span>$-2,342.34</span>
<p><span class=check id=formatTest14>0.233</span> <span>23.3%</span>
<p><span class=check id=formatTest14a>0.233</span> <span>23.30%</span>
<p><span class=check id=formatTest15>-434.4343</span> <span>-434.43</span>
<p><span class=check id=formatTest15a>434.4343</span> <span>434.43</span>
<p><span class=check id=formatTest16>434.4343</span> <span>434.434</span>
<p><span class=check id=formatTest17>1,345,234</span> <span>1,345,234</span>


<p>German Locale
<p><span class=check id=formatTestDe1>4335,20</span> <span>4.335,20</span>
<p><span class=check id=formatTestDe1a>4.335,20</span> <span>4.335,20</span>
<p><span class=check id=formatTestDe2>4335,20</span> <span>4.335,2</span>
<p><span class=check id=formatTestDe2a>4.335,20</span> <span>4.335,2</span>
<p><span class=check id=formatTestDe3>4335,20</span> <span>4.335,2</span>
<p><span class=check id=formatTestDe3a>4.335,20</span> <span>4.335,2</span>
<p><span class=check id=formatTestDe4>4335,20</span> <span>4335,20</span>
<p><span class=check id=formatTestDe4a>4.335,20</span> <span>4335,20</span>
<p><span class=check id=formatTestDe5>4335,20</span> <span>4.335</span>
<p><span class=check id=formatTestDe5a>4.335,20</span> <span>4.335</span>
<p><span class=check id=formatTestDe6>4335,80</span> <span>4.336</span>
<p><span class=check id=formatTestDe6a>4.335,80</span> <span>4.336</span>
<p><span class=check id=formatTestDe7>4335,80</span> <span>4336</span>
<p><span class=check id=formatTestDe8>566</span> <span>566</span>
<p><span class=check id=formatTestDe9>566</span> <span>566</span>
<p><span class=check id=formatTestDe10>566,0</span> <span>566</span>
<p><span class=check id=formatTestDe12>-2342,34</span> <span>-2.342,34</span>
<p><span class=check id=formatTestDe12a>-2342,34</span> <span>-2.342,34</span>

<p>France Locale
<p><span class=check id=formatTestFr1>4335,20</span> <span>4 335,20</span>
<p><span class=check id=formatTestFr1a>4 335,20</span> <span>4 335,20</span>
<p><span class=check id=formatTestFr2>4335,20</span> <span>4 335,2</span>
<p><span class=check id=formatTestFr2a>4 335,20</span> <span>4 335,2</span>
<p><span class=check id=formatTestFr3>4335,20</span> <span>4 335,2</span>
<p><span class=check id=formatTestFr3a>4 335,20</span> <span>4 335,2</span>
<p><span class=check id=formatTestFr4>4335,20</span> <span>4335,20</span>
<p><span class=check id=formatTestFr4a>4 335,20</span> <span>4335,20</span>
<p><span class=check id=formatTestFr5>4335,20</span> <span>4 335</span>
<p><span class=check id=formatTestFr5a>4 335,20</span> <span>4 335</span>
<p><span class=check id=formatTestFr6>4335,80</span> <span>4 336</span>
<p><span class=check id=formatTestFr6a>4 335,80</span> <span>4 336</span>
<p><span class=check id=formatTestFr7>4335,80</span> <span>4336</span>
<p><span class=check id=formatTestFr8>566</span> <span>566</span>
<p><span class=check id=formatTestFr9>566</span> <span>566</span>
<p><span class=check id=formatTestFr10>566,0</span> <span>566</span>
<p><span class=check id=formatTestFr12>-2342,34</span> <span>-2 342,34</span>

<p>Switzerland Locale
<p><span class=check id=formatTestCh1>4335.20</span> <span>4'335.20</span>
<p><span class=check id=formatTestCh1a>4'335.20</span> <span>4'335.20</span>
<p><span class=check id=formatTestCh2>4335.20</span> <span>4'335.2</span>
<p><span class=check id=formatTestCh2a>4'335.20</span> <span>4'335.2</span>
<p><span class=check id=formatTestCh3>4335.20</span> <span>4'335.2</span>
<p><span class=check id=formatTestCh3a>4'335.20</span> <span>4'335.2</span>
<p><span class=check id=formatTestCh4>4335.20</span> <span>4335.20</span>
<p><span class=check id=formatTestCh4a>4'335.20</span> <span>4335.20</span>
<p><span class=check id=formatTestCh5>4335.20</span> <span>4'335</span>
<p><span class=check id=formatTestCh5a>4'335.20</span> <span>4'335</span>
<p><span class=check id=formatTestCh6>4335.80</span> <span>4'336</span>
<p><span class=check id=formatTestCh6a>4'335.80</span> <span>4'336</span>
<p><span class=check id=formatTestCh7>4335.80</span> <span>4336</span>
<p><span class=check id=formatTestCh8>566</span> <span>566</span>
<p><span class=check id=formatTestCh9>566</span> <span>566</span>
<p><span class=check id=formatTestCh10>566.0</span> <span>566</span>
<p><span class=check id=formatTestCh12>-2342.34</span> <span>-2'342.34</span>


<p><span class=check id=formatTestDefault1>12345.23</span> <span>12,345.23</span>
<p><span class=check id=formatTestDefault2>12345.2324</span> <span>12,345</span>
<p><span class=check id=formatTestDefault3>12.345,2323</span> <span>12.345,23</span>

<p>Parse Tests
<p><span id=parseTest1>2342.34</span> <span>2342.34</span>
<p><span id=parseTest2>2,342.34</span>  <span>2342.34</span>
<p><span id=parseTest3>-2342.34</span>  <span>-2342.34</span>
<p><span id=parseTest4>-$2342.34</span> <span>-2342.34</span>
<p><span id=parseTest5>$-2342.34</span> <span>-2342.34</span>
<p><span id=parseTest6>2342.34USD</span>  <span>2342.34</span>
<p><span id=parseTest7>2342</span> <span>2342</span>
<p><span id=parseTest8>23.42%</span>  <span>.2342</span>


<p>Different Elements
<p><div class=f>1230.45</div>
<p><input class=f type=text value="1230.45">
<p><span class=f>1230.45</span>
<p class=f>1230.45</p>
<p><table><tr><td class=f>1230.45</td></tr></table>

</body>
</html>